<html>
<head><meta charset="utf-8"><title>let_chain implementation · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html">let_chain implementation</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="152560038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560038">(Dec 26 2018 at 16:29)</a>:</h4>
<p>So <span class="user-mention" data-user-id="126931">@centril</span> ...</p>



<a name="152560115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560115">(Dec 26 2018 at 16:30)</a>:</h4>
<p>... is the primary question you were asking me about how to modify the <em>parser</em>, or are you also wondering about the latter phases of the compiler?</p>



<a name="152560147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560147">(Dec 26 2018 at 16:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I've done some of that already but I might have questions about it... the bigger question is whether you find adding <code>ast::ExprKind::Let(..)</code> and removing <code>ExprKind::{IfLet, WhileLet}</code></p>



<a name="152560148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560148">(Dec 26 2018 at 16:31)</a>:</h4>
<p>...to be a good idea</p>



<a name="152560196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560196">(Dec 26 2018 at 16:32)</a>:</h4>
<p>that's the cleanest way I could think of to implement the parser</p>



<a name="152560204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560204">(Dec 26 2018 at 16:32)</a>:</h4>
<p>it feels pretty reasonable to me</p>



<a name="152560208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560208">(Dec 26 2018 at 16:32)</a>:</h4>
<p>and it will probably lead to better diagnostics / easier lowering / also more extensible if we want to improve lang design in the future</p>



<a name="152560215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560215">(Dec 26 2018 at 16:33)</a>:</h4>
<p>I guess the concern is that <code>let</code> isn't permitted in all places that expressions are permitted, obviously</p>



<a name="152560221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560221">(Dec 26 2018 at 16:33)</a>:</h4>
<p>but the same is true of (e.g.) <code>impl Trait</code> types</p>



<a name="152560230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560230">(Dec 26 2018 at 16:33)</a>:</h4>
<p>it seems particularly ok if this is confined to the AST, and not the HIR</p>



<a name="152560290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560290">(Dec 26 2018 at 16:34)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> has often expressed the vision (which I agree with) that the AST ought to "naturally reflect" the things the user wrote, basically, whereas the HIR is more oriented around the compiler</p>



<a name="152560296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560296">(Dec 26 2018 at 16:34)</a>:</h4>
<p>I forget exactly how they put it but it seems to fit this scenario</p>



<a name="152560297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560297">(Dec 26 2018 at 16:34)</a>:</h4>
<p>makes a lot of sense</p>



<a name="152560341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560341">(Dec 26 2018 at 16:36)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  the other question is about the parser; In the RFC, specifically this subsection: <a href="https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md#a-few-more-examples" target="_blank" title="https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md#a-few-more-examples">https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md#a-few-more-examples</a>, I specified some precedence changes</p>



<a name="152560384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560384">(Dec 26 2018 at 16:36)</a>:</h4>
<p>I got the first one to work but not the other 3</p>



<a name="152560389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560389">(Dec 26 2018 at 16:36)</a>:</h4>
<p>Consider having <code>if</code> and <code>while</code> take not an expression but <code>pattern-expression</code>?</p>



<a name="152560391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560391">(Dec 26 2018 at 16:36)</a>:</h4>
<p>where <code>pattern-expression = EXPR | LET PATTERN</code></p>



<a name="152560449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560449">(Dec 26 2018 at 16:38)</a>:</h4>
<p>I’d rather not make <code>let pat = expr </code> an expression at AST level, that sounds like foot waiting to be shot into</p>



<a name="152560468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560468">(Dec 26 2018 at 16:39)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span>  my first thought was to do it like that, but <code>if let a = b &amp;&amp; c &amp;&amp; let c = d { ... }</code> is permitted and we might want to extend to <code>||</code> in the future; it also felt hard to get this right re. precedence since <code>if a &amp;&amp; b || c &amp;&amp; d { .. }</code> still needs to parse</p>



<a name="152560536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560536">(Dec 26 2018 at 16:41)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  I wonder if I should follow the RFC to the letter re. the precedence changes of:</p>
<div class="codehilite"><pre><span></span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="n">Range</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">start</span>: <span class="nc">_</span><span class="p">,</span><span class="w"> </span><span class="n">end</span>: <span class="nc">_</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">true</span><span class="p">..</span><span class="kc">true</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="n">PAT</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">break</span><span class="w"> </span><span class="kc">true</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="n">PAT</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">F</span><span class="p">..</span><span class="o">||</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="n">PAT</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">t</span><span class="p">..</span><span class="o">&amp;&amp;</span><span class="kc">false</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</pre></div>


<p>it seems more messy to do this change and honestly I cannot say that changing the parse is more intuitive</p>



<a name="152560547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560547">(Dec 26 2018 at 16:41)</a>:</h4>
<blockquote>
<p>I got the first one to work but not the other 3</p>
</blockquote>
<p>i.e., <code>if let PAT = break true &amp;&amp; false { ... }</code> parsed incorrectly?</p>



<a name="152560549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560549">(Dec 26 2018 at 16:41)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> do you have a branch somewhere?</p>



<a name="152560595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560595">(Dec 26 2018 at 16:42)</a>:</h4>
<p>re: following the RFC to the letter, I personally consider the RFC more of a "guideline", though of course we have to be clear about deviations and the reasons for them</p>



<a name="152560604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560604">(Dec 26 2018 at 16:42)</a>:</h4>
<p>but if we encounter complications or experience that makes us rethink what was decided, I think that's ok</p>



<a name="152560607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560607">(Dec 26 2018 at 16:43)</a>:</h4>
<p>as is implementing in stages :)</p>



<a name="152560610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560610">(Dec 26 2018 at 16:43)</a>:</h4>
<p>;) in this case I also wrote the RFC :P</p>



<a name="152560613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560613">(Dec 26 2018 at 16:43)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  yeah, <code>if let PAT = break true &amp;&amp; false { ... }</code> parses incorrectly (it parses as it does today)</p>



<a name="152560615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560615">(Dec 26 2018 at 16:43)</a>:</h4>
<p>that said, I'm not clear on exactly what you are proposing</p>



<a name="152560616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560616">(Dec 26 2018 at 16:43)</a>:</h4>
<p>yes so the problem seems to be what restrictions were "intended" for</p>



<a name="152560653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560653">(Dec 26 2018 at 16:44)</a>:</h4>
<p>but I guess you are basically having problems with things open on the "right-hand side"</p>



<a name="152560654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560654">(Dec 26 2018 at 16:44)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  (I'm suggesting) to let them parse as they do today</p>



<a name="152560665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560665">(Dec 26 2018 at 16:44)</a>:</h4>
<p>what about other examples, e.g. <code>if let PAT = x &amp;&amp; foo.is_true()</code></p>



<a name="152560672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560672">(Dec 26 2018 at 16:44)</a>:</h4>
<p>I feel ok about certain things -- like <code>break</code> -- yielding parse errors</p>



<a name="152560683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560683">(Dec 26 2018 at 16:45)</a>:</h4>
<p>I'm not keen about <code>&amp;&amp;</code> being part of the matched expression sometimes but not other times</p>



<a name="152560685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560685">(Dec 26 2018 at 16:45)</a>:</h4>
<p>hah; I haven't tested fields / methods yet; good point</p>



<a name="152560691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560691">(Dec 26 2018 at 16:45)</a>:</h4>
<p>(and successfully parsing, I mean)</p>



<a name="152560695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560695">(Dec 26 2018 at 16:45)</a>:</h4>
<p>anyway, to figure out why it's not working, and how best to make it work, I'd have to look at the code I guess</p>



<a name="152560701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560701">(Dec 26 2018 at 16:45)</a>:</h4>
<p>though I can sort of imagine how it's going wrong</p>



<a name="152560750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560750">(Dec 26 2018 at 16:46)</a>:</h4>
<p>yeah; the code changes are very prototype-y atm</p>



<a name="152560757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560757">(Dec 26 2018 at 16:46)</a>:</h4>
<p>ill throw up a temporary branch</p>



<a name="152560763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560763">(Dec 26 2018 at 16:46)</a>:</h4>
<p>I am not very keen on the "restrictions" impl, I feel like what we would rather have is that the "parse expression" fn is kind of a template, that takes as a parameter the "kind of expression" for the cases where it recurs</p>



<a name="152560766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560766">(Dec 26 2018 at 16:46)</a>:</h4>
<p>but anyway</p>



<a name="152560773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560773">(Dec 26 2018 at 16:47)</a>:</h4>
<blockquote>
<p>yeah; the code changes are very prototype-y atm</p>
</blockquote>
<p>seems fine</p>



<a name="152560845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560845">(Dec 26 2018 at 16:48)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <a href="https://github.com/Centril/rust/tree/let-chains-2-hack" target="_blank" title="https://github.com/Centril/rust/tree/let-chains-2-hack">https://github.com/Centril/rust/tree/let-chains-2-hack</a></p>



<a name="152560921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152560921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152560921">(Dec 26 2018 at 16:50)</a>:</h4>
<p>(ignore the various changes to Debug and such... they were just convenient hacks to see precedence changes...)</p>



<a name="152561019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152561019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152561019">(Dec 26 2018 at 16:53)</a>:</h4>
<p>(method calls and field projections seem to work right)</p>



<a name="152561078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152561078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152561078">(Dec 26 2018 at 16:54)</a>:</h4>
<p>ok</p>



<a name="152561190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152561190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152561190">(Dec 26 2018 at 16:57)</a>:</h4>
<blockquote>
<p>I feel like what we would rather have is that the "parse expression" fn is kind of a template, that takes as a parameter the "kind of expression" for the cases where it recurs</p>
</blockquote>
<p>that seems like a good idea as a bigger refactoring; I think <code>parser.rs</code> is pretty stateful spaghetti atm so that'd help</p>



<a name="152561539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152561539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152561539">(Dec 26 2018 at 17:06)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  so when you say "I'm not keen about &amp;&amp; being part of the matched expression sometimes but not other times" you mean that from a lang design POV you'd prefer to make the changes in the "A few more examples"?</p>



<a name="152561798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152561798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152561798">(Dec 26 2018 at 17:13)</a>:</h4>
<p>maybe..</p>



<a name="152561855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152561855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152561855">(Dec 26 2018 at 17:14)</a>:</h4>
<p>I mostly mean that if you have:</p>
<div class="codehilite"><pre><span></span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="n">foo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">bar</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="n">baz</span><span class="p">.</span><span class="n">is_true</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">..</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</pre></div>


<p>and it parses like <code>let (foo = bar)</code>, then I think that every other use of <code>&amp;&amp;</code> should either not parse or be treated as part of the <code>if</code>, not the expression being matched</p>



<a name="152561859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152561859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152561859">(Dec 26 2018 at 17:14)</a>:</h4>
<p>in other words, maybe those examples with <code>break</code> and stuff should just error</p>



<a name="152561884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152561884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152561884">(Dec 26 2018 at 17:15)</a>:</h4>
<p>I think it would be confusing if the <code>&amp;&amp;</code> <em>sometimes</em> parses as part of the expression and <em>sometimes</em> as part of the <code>if</code></p>



<a name="152561886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152561886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152561886">(Dec 26 2018 at 17:15)</a>:</h4>
<p>but I've not given this a lot of thought</p>



<a name="152561894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152561894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152561894">(Dec 26 2018 at 17:15)</a>:</h4>
<p>I confess :)</p>



<a name="152562586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152562586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152562586">(Dec 26 2018 at 17:30)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  so if we write <code>{ a &amp;&amp; b..&amp;&amp;c };</code> it currently associates as <code>{ a &amp;&amp; (b..(&amp;&amp;c)) };</code> (it won't typeck...) -- idk if we can change this tho due to macros; and it seems unlikely that someone will get bitten by this?</p>



<a name="152562593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152562593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152562593">(Dec 26 2018 at 17:31)</a>:</h4>
<p>the type error you get is pretty clear about the problem</p>



<a name="152563570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152563570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152563570">(Dec 26 2018 at 17:54)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> So what do you think about this?: To make progress, I'll implement this first without changing the 4 examples since that is the simplest and most minimal change, it is also forward compatible with changing the precedence later...</p>



<a name="152646817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152646817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152646817">(Dec 28 2018 at 10:20)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span>  thoughts on the above discussion? wdyt about <code>ExprKind::Let</code> ?</p>



<a name="152647334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152647334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152647334">(Dec 28 2018 at 10:35)</a>:</h4>
<p>I think I'd prefer the nagisa's variant for now.</p>



<a name="152647395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152647395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152647395">(Dec 28 2018 at 10:36)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> so this would be a <code>Vec&lt;P&lt;ExprOrLet&gt;&gt;</code> in <code>::If</code> and <code>::While</code> ?</p>



<a name="152647397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152647397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152647397">(Dec 28 2018 at 10:36)</a>:</h4>
<p>(the Vec is for the &amp;&amp;s)</p>



<a name="152647454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152647454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152647454">(Dec 28 2018 at 10:38)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span>  also, what are your thoughts on the 4 ambiguities (<a href="https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md#a-few-more-examples" target="_blank" title="https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md#a-few-more-examples">https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md#a-few-more-examples</a>) I've referenced above?</p>



<a name="152649876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152649876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152649876">(Dec 28 2018 at 11:41)</a>:</h4>
<blockquote>
<p>Vec&lt;P&lt;ExprOrLet&gt;&gt;</p>
</blockquote>
<p>Yes, something like that, maybe even <code>Vec&lt;ExprOrLet&gt;</code> without <code>P</code>.</p>



<a name="152650253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152650253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152650253">(Dec 28 2018 at 11:51)</a>:</h4>
<p>Precedence specified in the RFC looks ok to me.</p>



<a name="152650312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152650312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152650312">(Dec 28 2018 at 11:52)</a>:</h4>
<p>We are basically parsing the expression after <code>let PAT = </code> as an arbitrary expression with restriction "no <code>&amp;&amp;</code> and no <code>||</code>".</p>



<a name="152650380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152650380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152650380">(Dec 28 2018 at 11:54)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> ah, my other thought was to just have <code>ExprKind::Let</code> and have <code>|this| this.parse_assoc_expr_with(4, ...)</code> in <code>parse_let_expr</code></p>



<a name="152650390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152650390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152650390">(Dec 28 2018 at 11:55)</a>:</h4>
<p>well, substitute 4 for the precedence just above &amp;&amp; so that it doesn't parse &amp;&amp;</p>



<a name="152650402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152650402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152650402">(Dec 28 2018 at 11:55)</a>:</h4>
<p><code>LAnd =&gt; 6,</code> <span class="emoji emoji-1f642" title="slight smile">:slight_smile:</span></p>



<a name="152650404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152650404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152650404">(Dec 28 2018 at 11:55)</a>:</h4>
<p>I'll try your approach</p>



<a name="152650406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/let_chain%20implementation/near/152650406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/let_chain.20implementation.html#152650406">(Dec 28 2018 at 11:55)</a>:</h4>
<p>We had restrictions like this before, but they were removed.<br>
See e.g. <code>RESTRICTION_NO_BAR_OP</code> removed in <a href="https://github.com/rust-lang/rust/pull/23930" target="_blank" title="https://github.com/rust-lang/rust/pull/23930">https://github.com/rust-lang/rust/pull/23930</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>